package com.jumi.microservice.material.mapper;

import com.jumi.microservice.material.domain.JmMaterialSmallUnit;
import com.jumi.microservice.material.domain.example.JmMaterialSmallUnitExample;
import com.jumi.microservice.material.dto.JmUnitResponse;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @description: 商品最小单位Mapper接口
 * @author: ZhangY
 */
@Repository
public interface JmMaterialSmallUnitMapper
{
	/**
	 * @Description: 根据主键删除
	 * @Param: [smunitId]
	 * @Return: int
	 */
	int deleteByPrimaryKey(@Param("smunitId") Integer smunitId, @Param("updateBy") String updateBy);

	/**
	 * @Description: 保存一条数据
	 * @Param: [smunit]
	 * @Return: int
	 */
	int insertSelective(JmMaterialSmallUnit smunit);

	/**
	 * @Description: 条件查询
	 * @Param: [example]
	 * @Return: java.util.List<com.jumi.microservice.material.domain.Smunit>
	 */
	List<JmMaterialSmallUnit> selectByExample(JmMaterialSmallUnitExample example);

	/**
	 * @Description: 根据主键查询
	 * @Param: [smunitId]
	 * @Return: com.jumi.microservice.material.domain.Smunit
	 */
	JmMaterialSmallUnit selectByPrimaryKey(Integer smunitId);

	/**
	 * @Description: 更新一条数据
	 * @Param: [smunit]
	 * @Return: int
	 */
	int updateByPrimaryKeySelective(JmMaterialSmallUnit smunit);

	/**
	 * @Description: 根据unitIds查询单位列表
	 * @Param UnitIds
	 * @Return {@link List< JmUnitResponse>}
	 * @Throws
	 * @Author Abel Yang
	 * @Date 2020/8/20/020 15:43
	 */
	List<JmUnitResponse> findByUnitIds(List<Integer> unitIds);

	/**
	 * 根据单位名称返回id
	 */
	Long findByUnitName(String unitName);
}
